package com.vben.ai.playground.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.vben.ai.playground.entity.PlaygroundScore;
import com.vben.ai.playground.entity.PlaygroundScoreDTO;
import com.vben.ai.playground.service.PlaygroundScoreService;
import com.vben.common.core.util.R;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/playground/score")
public class PlaygroundScoreController {

    @Resource
    private PlaygroundScoreService playgroundScoreService;

    @GetMapping("/page")
    public R<Page<PlaygroundScore>> page(PlaygroundScoreDTO playgroundScore) {
        Page<PlaygroundScore> page = playgroundScore.buildMpPage();
        return R.ok(playgroundScoreService.page(page));
    }
}
